#!/usr/bin/env python

import logging, logging.config

try:
    logging.config.fileConfig("logging.properties")
    logger = logging.getLogger("log02")
except:
    logger = logging.getLogger()

class LogUtil:
    """
    This class is used to do logging in OpenID ISSO application.
    """
    def log(sLogLevel, sLogMessage):
        if sLogLevel == logging.DEBUG:
            logger.debug(sLogMessage)
        elif sLogLevel == logging.INFO:
            logger.info(sLogMessage)
        elif sLogLevel == logging.WARN:
            logger.warning(sLogMessage)
        elif sLogLevel == logging.ERROR:
            logger.error(sLogMessage)
        elif sLogLevel == logging.CRITICAL:
            logger.critical(sLogMessage)
        else:
            logger.debug(sLogMessage)
    
    log = staticmethod(log)